﻿Public Class CongTy
    Dim _DSNV As New List(Of NhanVien)
    Public Sub Nhap()
        Dim SoNV As Integer
        Console.Write("Nhap So Nhan Vien: ")
        SoNV = Convert.ToInt32(Console.ReadLine)
        For i As Integer = 0 To SoNV - 1
            Dim NV As NhanVien
            Dim LoaiNv As Integer
            Console.Write("Nhap loai nhan vien (0: Nhan vien VP, 1: Nhan Vien SX, 2->: Nhan Vien QL: ")
            LoaiNv = Convert.ToInt32(Console.ReadLine)
            If LoaiNv = 0 Then
                NV = New NhanVienVP
            ElseIf LoaiNv = 1 Then
                NV = New NhanVienSX
            Else
                NV = New NhanVienQL
            End If
            NV.Nhap()
            _DSNV.Add(NV)
        Next
    End Sub
    Public Sub Xuat()
        For i As Integer = 0 To _DSNV.Count - 1
            Console.WriteLine("Thong tin nhan vien thu {0}", i + 1)
            _DSNV(i).Xuat()
        Next
    End Sub
    Public Function TinhTongLuong() As Double
        Dim Tong As Double = 0
        For i As Integer = 0 To _DSNV.Count - 1
            Tong += _DSNV(i).TinhLuong()
        Next
        Return Tong
    End Function
End Class
